<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    const p=new Promise(function (resolve,reject) {
        setTimeout(function () {
            // let data='数据库的用户数据'
            // resolve(data)

            let err='数据读取失败'
            reject(err)
        },1000)
    })
    p.then(function (value) {
        console.log(value)
    },function (reason) {
        console.log(reason)
    })
</script>
</body>
</html>
